<?php

header("Content-type:text/html;charset=UTF-8");
session_start();
if (empty($_SESSION['id'])) {
    echo '{"code":"400","msg":"未登录"}';

    die();
}
$id = addslashes($_POST['id']);
$pid = addslashes($_POST['pid']);
$md5 = addslashes($_POST['md5']);
$info = addslashes($_POST['info']);
$conn = mysqli_connect('127.0.0.1', 'root', 'root', 'lzp');
mysqli_query($conn, 'set names utf8');
$sql = "update p_tn18 set pid='$pid',md5='$md5',info='$info' where id=$id";
//执行 sql
$result = mysqli_query($conn, $sql);


// $info = mysqli_fetch_assoc($result);

// var_dump($result) ;
if ($result == true) {
    echo 1;
} else {
    echo 2;
}